<?php
	/*Pagina que exibe o perfil do usuario no curso, alem de notas e frequencia*/

	session_start();

	include("/var/www/html/vivencias/conexaoBD.php");

	$query = "SELECT * FROM usuarios WHERE idUsuario='".$_SESSION['idUsuario']."'";
	$resultado = mysql_query($query,$conexao);
	if (!$resultado) {
    		die('Ocorreu um erro no sistema: ' . mysql_error());
	}
	else{
		$objeto = mysql_fetch_object($resultado);
	}

	//Verifica se o usuários possui blog
	$query1      = "SELECT idBlog FROM blogs WHERE idUsuario='".$_SESSION['idUsuario']."' AND idCurso='".$_SESSION['idCurso']."'";
	$resultado1  = mysql_query($query1,$conexao);
	$objeto1     = mysql_fetch_object($resultado1);
	$num_result1 = mysql_num_rows($resultado1);

	if(($_SESSION['idTipoUsuario']=='0') && ($objeto->sexo=='Feminino')){
		$tipoUsuario = 'Professora';
	}else if(($_SESSION['idTipoUsuario']=='0') && ($objeto->sexo=='Masculino')){
 		$tipoUsuario = 'Professor';
	}else if(($_SESSION['idTipoUsuario']=='1') && ($objeto->sexo=='Feminino')){
		$tipoUsuario = 'Tutora';
	}else if(($_SESSION['idTipoUsuario']=='1') && ($objeto->sexo=='Masculino')){
		$tipoUsuario = 'Tutor';
	}else if(($_SESSION['idTipoUsuario']=='2') && ($objeto->sexo=='Feminino')){
		$tipoUsuario = 'Aluna';
	}else if(($_SESSION['idTipoUsuario']=='2') && ($objeto->sexo=='Masculino')){
		$tipoUsuario = 'Aluno';
	}else if($_SESSION['idTipoUsuario']=='3'){
		$tipoUsuario = 'Paciente';
	}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Experi&ecirc;ncias do Processo de Adoecimento</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="vivencias.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onLoad="MM_preloadImages('imagens/stt_particip2.jpg')">
<div align="center">
  <table width="1000" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="10%" align="left" valign="top"><img src="imagens/logo.jpg" width="66" height="53"></td>
                  <td width="90%"><img src="imagens/tit1.jpg" width="612" height="28"></td>
                </tr>
              </table></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr align="left" valign="middle">
                  <td colspan="3" class="nomecurso"><?php echo $_SESSION['nomeCurso'];?></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td><a href="index.php"><img src="imagens/sair.gif" width="33" height="19" border="0"></a></td>
                </tr>
                <tr align="left" valign="middle">
                  <td width="25%">&nbsp;</td>
                  <td width="22%">&nbsp;</td>
                  <td width="52%">&nbsp;</td>
                  <td width="0%">&nbsp;</td>
                  <td width="0%">&nbsp;</td>
                  <td width="1%">&nbsp;</td>
                </tr>
              </table></td>
          </tr>
          <tr>
            <td><table width="96%" border="0" cellspacing="0" cellpadding="0">
                <tr align="left" valign="top">
		<!-- Somente o professor do curso pode visualizar o gerenciamento.-->
		<?php if(($_SESSION['idTipoUsuario']=="0")||($_SESSION['idTipoUsuario']=="1")||($_SESSION['idTipoUsuario'] == "5")){?>
                  <td width="3%" background="imagens/bar_fnd_8.jpg" bgcolor="EBF4F9"><a href="relatorios.htm"><img src="imagens/mn_8.jpg" width="23" height="161" border="0"></a></td>
		<?php } ?>
                  <td width="3%" background="imagens/bar_fnd_7.jpg"><a href="info.php"><img src="imagens/mn_7.jpg" width="23" height="137" border="0"></a></td>
                  <td width="3%" background="imagens/bar_fnd_6.jpg"><a href="esppess.php"><img src="imagens/mn_6.jpg" width="23" height="156" border="0"></a></td>
                  <td width="64%" bgcolor="F4F8FE">
					<table width="816" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="10" align="left" valign="top"><img src="imagens/pix_cor6b.gif" width="10" height="5"></td>
                        <td width="105"><a href="esppess.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('participantes','','imagens/stt_particip2.jpg',1)"><img src="imagens/stt_particip1.jpg" name="participantes" width="105" height="21" border="0"></a></td>
                        <td width="1"><img src="imagens/pix_cor6b.gif" width="10" height="5"></td>
                        <td width="337"><img src="imagens/stt_pagP2.jpg" width="121" height="21"></td>
                        <td width="113">&nbsp;</td>
                      </tr>
                      <tr>
                        <td colspan="5">&nbsp;</td>
                      </tr>
                    </table>
                    <br>
                    <table width="100%" border="0" cellspacing="1" cellpadding="5">
                     <form enctype="multipart/form-data" action="modificaPgpss.php" method="post">
     		     	 <tr>
                        <td><div align="center">
                            <table width="95%" border="0" cellpadding="5" cellspacing="1">
                              <tr>
                                <td align="left" valign="middle" bgcolor="d8e4f5" class="ativo"><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
                                    <tr align="center" bgcolor="5f83c4" class="texttab">
                                      <td width="89%" align="left" valign="middle"><span><strong><?php echo $objeto->nome; ?></strong></a></span> </td>
                                      <td width="11%" align="right" valign="middle" class="texto2">
										<strong><center><?php echo $tipoUsuario;?></center></strong>
									  </td>
                                    </tr>
                                  </table>
								</td>
                              </tr>
                              <tr>
                                <td align="left" valign="middle" bgcolor="d8e4f5" class="ativo"><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
				
                                    <tr align="center" bgcolor="d8e4f5" class="texttab">
                                      <td width="100%" align="left" valign="middle" bgcolor="d8e4f5"><span class="texto2">Ir
                                        para&nbsp;&nbsp;</span><input type="button" name="Submit" value="Blog" onClick="window.location='blogPosts.php?idBlog=<?php echo $objeto1->idBlog;?>'" <?php if(!$num_result1){ ?>disabled<?php }?>></a>
                                      </td>
                                    </tr>
                                  </table></td>
                              </tr>
                              <tr>
                                <td bgcolor="#FFFFFF" class="ativo">&nbsp;</td>
                              </tr>
                              <tr>
                                <td bgcolor="d8e4f5" class="ativo"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
                                    <tr align="center" bgcolor="#38708F" class="texttab">
                                      <td width="100%" colspan="2" valign="top" bgcolor="d8e4f5">
                                        <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
                                          <tr align="center" valign="middle" bgcolor="f4f1fc" class="texto">
                                            <td width="16%" align="left" bgcolor="bccde7">
                                              <p align="left" class="texto2"><strong>Email</strong></p>
											</td>
                                            <td colspan="2" align="left" bgcolor="bccde7"><input name="email" type="text" value="<?php echo $objeto->email; ?>" size="35"><input type="hidden" name="idUsuario" value="<?php echo $_SESSION['idUsuario'];?>">
                                            </td>
                                          </tr>
                                          <tr align="center" valign="middle" bgcolor="f4f1fc" class="texto">
                                            <td align="left" bgcolor="bccde7" class="texto2"><strong>Telefone</strong></td>
                                            <td align="left" bgcolor="bccde7"><input name="telefone" type="text" value="<?php echo $objeto->telefone; ?>" size="30"></td><td align="left" bgcolor="bccde7">
					<?php
						if(($_SESSION['idTipoUsuario']==2) || ($_SESSION['idTipoUsuario']==3)){
							$queryG     = "SELECT grupo FROM usuariosCursos WHERE idUsuario='".$_SESSION['idUsuario']."' AND idCurso='".$_SESSION['idCurso']."'";
							$resultadoG = mysql_query($queryG,$conexao);
							$objetoG    = mysql_fetch_object($resultadoG);

					?>

						<?php
							if($objetoG->grupo){
								echo 'Grupo ' . $objetoG->grupo;
							}else{
								echo 'Sem Grupo';
							}
						?>
					<?php } ?>
					    </td>
                                          </tr>
                                          <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td align="left" class="texto2"><strong>Login</strong></td>
                                            <td align="left" class="texto2"><?php echo $objeto->email; ?></td>
                                            <td width="21%" rowspan="9" align="right" class="texto2">
						<?php
							if($objeto->foto){
								$foto = $objeto->foto;
							}else{
								$foto = "imagens/icn.usu.png";
							}
						?>

						<center><img src= "<?php echo $foto; ?>"  style="<?php $tamanhoImagem = getimagesize("http://localhost" . $objeto->foto); if($tamanhoImagem[0] > $tamanhoImagem[1] && $tamanhoImagem[0] > 150) echo "width:150px; height:auto;"; else if($tamanhoImagem[1]>200 && ($tamanhoImagem[1]/$tamanhoImagem[0]) >= (200/150)) echo "height:200px; width:auto;";else if($tamanhoImagem[0]>150 && ($tamanhoImagem[1]/$tamanhoImagem[0]) <= (200/150)) echo "width: 150px; height:auto;"; ?>"></center>
					    </td>
                                          </tr>
                                          <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td align="left" class="texto2">

				<?php
					if($_SESSION['idTipoUsuario']==2){
						echo '<strong>Curso</strong>';
						echo '</td>';
						echo '<td align="left" class="texto2">';
						echo $objeto->graduacao;
						echo '</td>';

					}
					else if($_SESSION['idTipoUsuario']==0 || $_SESSION['idTipoUsuario']==1){
						echo "<strong>Forma&ccedil;&atilde;o</strong>";
						echo '</td>';
						echo '<td align="left" class="texto2">';
						echo $objeto->graduacao;
						echo '</td>';

					} else {
						echo "<strong>Profiss&atilde;o</strong>";
						echo '</td>';
						echo '<td align="left" class="texto2">';
						echo $objeto->profissao;
						echo '</td>';
					}

				?>
                                          </tr>
                                          <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
				<?php
					if($_SESSION['idTipoUsuario']==2){
                                            echo '<td align="left" class="texto2"><strong>Institui&ccedil;&atilde;o</strong></td>';
                                            echo '<td align="left" class="texto2">';
					    echo $objeto->instituicao;
					    echo '</td>';
					}else if($_SESSION['idTipoUsuario']==0 || $_SESSION['idTipoUsuario']==1){

					    echo '<td align="left" class="texto2"><strong>V&iacute;nculo Profissional</strong></td>';
                                            echo '<td align="left" class="texto2">';
					    echo $objeto->vinculoProfissional;
					    echo '</td>';
					}
				?>
                                          </tr>
				<?php
					if($_SESSION['idTipoUsuario']==2){
                                          echo '<tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">';
                                          echo '<td align="left" class="texto2"><strong>Per&iacute;odo</strong></td>';
                                          echo '<td align="left" class="texto2">';
					  echo $objeto->periodo;
					  echo '</td>';
					  echo '</tr>';
					}else {

					  echo '<tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">';
                                          echo '<td align="left" class="texto2"><strong>Data Cadastro</strong></td>';
                                          echo '<td align="left" class="texto2">';
					  echo ereg_replace("([0-9]{2}([0-9]{2})?)[/.-]([01]?[0-9])[/.-]([0123]?[0-9])","\\4-\\3-\\1",$objeto->dataCadastro);
					  echo '</td>';
					  echo '</tr>';

					}
				?>
                                          <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td align="left" class="texto2"><strong>Nascimento</strong></td>
                                            <td align="left" class="texto2"><?php echo $nascimento = ereg_replace("([0-9]{2}([0-9]{2})?)[/.-]([01]?[0-9])[/.-]([0123]?[0-9])","\\4-\\3-\\1",$objeto->nascimento);?></td>
                                          </tr>
                                          <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td align="left" class="texto2"><strong>Sexo</strong></td>
                                            <td align="left" class="texto2"><?php echo $objeto->sexo; ?>
                                            </td>
                                          </tr>
					  <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td align="left" class="texto2"><strong>Inserir Foto</strong></td>
                                            <td align="left" class="texto2"><input type="file" name="foto">
                                            </td>
                                          </tr>
					  <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td align="left" class="texto2"><strong>Senha</strong></td>
                                            <td align="left" class="texto2"><input name="senha" type="password" size="30">
                                            </td>
                                          </tr>
					  <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td align="left" class="texto2"><strong>Confirmar Senha</strong></td>
                                            <td align="left" class="texto2"><input name="confirmarSenha" type="password" size="30">
                                            </td>
                                          </tr>
                                          <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td align="left" class="texto2"><strong>Apresenta&ccedil;&atilde;o</strong></td>
                                            <td colspan="2" align="left" bgcolor="d8e4f5" class="texto2">
                                              <p>
                                                <textarea name="apresentacao" cols="40" rows="5"><?php echo $objeto->apresentacao; ?></textarea><input type="submit" name="Submit" value="Atualizar Dados">
                                              </p></td>
                                          </tr></form><!--
                                          <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td align="left" class="texto2"><strong>Participa&ccedil;&atilde;o
                                              em V&iacute;deos</strong></td>
                                            <td colspan="2" align="left" class="texto2">C&acirc;ncer:
                                              o recebimento do diagn&oacute;stico
                                              <input type="submit" name="Submit2" value="banco de v&iacute;deos">
                                            </td>
                                          </tr>-->
                                        </table></td>
                                    </tr>
                                  </table></td>
                              </tr>
                              <tr>
                                <td bgcolor="#FFFFFF" class="ativo">&nbsp;</td>
                              </tr>
			     <?php if($_SESSION['idTipoUsuario'] == "2" || $_SESSION['idTipoUsuario'] == "1"){ ?>
                              <tr>
                                <td bgcolor="d8e4f5" class="ativo"><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
                                    <tr align="center" bgcolor="#38708F" class="texttab">
                                      <td align="left" valign="top" bgcolor="5f83c4">
                                        <span class="ativo"><strong>Exerc&iacute;cios</strong></span></td>
                                    </tr>
                                    <tr align="center" bgcolor="#38708F" class="texttab">
                                      <td valign="top" bgcolor="d8e4f5"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
                                          <tr align="center" valign="middle" bgcolor="9eb5d8" class="texto">
                                            <td width="34%"> <p align="center" class="texto"><strong>Exerc&iacute;cio</strong></p></td>
                                            <td width="6%"> <div align="center"><strong>Data</strong></div></td>
					    					<td width="58%"> <div align="center"><strong>Coment&aacute;rio</strong></div></td>
                                            <td width="2%"> <div align="center"><strong>Nota</strong></div></td>

                                          </tr>
					  <?php

						$queryExercicios     = "SELECT distinct formulariosRespostas.idformulario,formularios.nomefor,formulariosCorrigidos.nota,formulariosCorrigidos.comentario FROM formulariosRespostas,formularios,formulariosCorrigidos WHERE formulariosRespostas.idUsuario='".$_SESSION['idUsuario']."' AND formulariosRespostas.enviado=1 AND formulariosRespostas.idformulario = formularios.idformulario AND formularios.idCurso='".$_SESSION['idCurso']."' AND formulariosCorrigidos.idformulario = formulariosRespostas.idformulario AND formulariosCorrigidos.idformulario = formularios.idformulario AND formulariosCorrigidos.idUsuario = '".$_SESSION['idUsuario']."'";
						$resultadoExercicios = mysql_query($queryExercicios,$conexao);
						$numResultado        = mysql_num_rows($resultadoExercicios);
						while($objetoExercicios = mysql_fetch_object($resultadoExercicios)){

							$queryData      = "SELECT max(dataHora) as data FROM formulariosRespostas WHERE idformulario=$objetoExercicios->idformulario AND idUsuario='".$_SESSION['idUsuario']."'";
							$resultadoData  = mysql_query($queryData,$conexao);
							$objetoData     = mysql_fetch_object($resultadoData);

							$data = explode(" ",$objetoData->data);
							$dataCerta = ereg_replace("([0-9]{2}([0-9]{2})?)[/.-]([01]?[0-9])[/.-]([0123]?[0-9])","\\4-\\3-\\1",$data[0]);

							$numExercicios  = $numExercicios + 1;
							$somatorioNotas = $somatorioNotas + $objetoExercicios->nota;
							$coment	= $objetoExercicios->comentario;
							$enter	= array("\r\n", "\n", "\r");
						   	$br	= '<br />';
							$comentario = str_replace($enter, $br, $coment);



					  ?>
                                          <tr align="center" valign="middle" bgcolor="d8e4f5" class="texto">
                                            <td> <p align="center" class="texto"><?php echo $objetoExercicios->nomefor;?></p></td>
                                            <td class="miudo"> <div align="center"><?php echo $dataCerta . ' ' . $data[1];?></div></td>
                                            <td> <div align="center"><?php echo $comentario;?></div></td>
					    <td> <div align="center"><?php echo $objetoExercicios->nota;?></div></td>
                                          </tr>
					  <?php } ?>

                                          <tr align="center" valign="middle" bgcolor="9eb5d8" class="texto">
                                            <td> <p align="center" class="texto">M&eacute;dia
                                                Exerc&iacute;cios</p></td>
                                            <td> <div align="center"></div></td>
                                            <td class="miudo"> <div align="center"></div></td>
                                            <td> <div align="center"><?php if($numExercicios > 0){ echo $media = ($somatorioNotas)/($numExercicios);}?></div></td>
                                          </tr>
                                        </table></td>
                                    </tr>
                                  </table></td>
                              </tr>
                              <tr>
                                <td bgcolor="#FFFFFF" class="ativo">&nbsp;</td>
                              </tr>
			      <?php 
					$count = 0;

					$queryNotas     = "SELECT * FROM notasUsuarios WHERE idCurso=".$_SESSION['idCurso']." AND idUsuario=".$_SESSION['idUsuario'];
					$resultadoNotas = mysql_query($queryNotas, $conexao);
					if(is_resource($resultadoNotas)){
						$objeto = mysql_fetch_object($resultadoNotas);
					} 


			      ?>
                              <tr>
                                <td bgcolor="d8e4f5" class="ativo"><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
                                    <tr align="center" bgcolor="#38708F" class="texttab">
                                      <td align="left" valign="top" bgcolor="5f83c4">
                                        <span class="ativo">Execu&ccedil;&atilde;o
                                        de atividades</span></td>
                                    </tr>
                                    <tr align="center" bgcolor="#38708F" class="texttab">
                                      <td valign="top" bgcolor="d8e4f5"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
                                          <tr bgcolor="d8e4f5" class="texttab">
                                            <td width="40%" valign="middle"> <div align="right">
                                                <p class="texto">Atividade na
                                                  Sala de Reuni&atilde;o</p>
                                              </div></td>
                                            <td width="4%">&nbsp;</td>
                                            <td width="26%" align="center" valign="middle" class="texto">
						<?php
							if($objeto->salaReuniao || $objeto->salaReuniao == "0"){
								$count++;
						?>
							<img src="imagens/ok.gif" width="25" height="24">
						<?php
							}else{
						?>
							<img src="imagens/x.gif" width="25" height="24">
						<?php   } ?>
                                            </td>
                                            <td width="30%" align="center" valign="middle" class="texto">
						<?php 
							if($objeto->salaReuniao || $objeto->salaReuniao == "0"){	
								echo $objeto->salaReuniao;
							}else{
								echo "-";
							}
						?>
					    </td>
                                          </tr>
                                          <tr bgcolor="d8e4f5" class="texttab">
                                            <td valign="middle"> <div align="right">
                                                <p class="texto">Atividade com
                                                  a Wiki</p>
                                              </div></td>
                                            <td>&nbsp;</td>
                                            <td align="center" valign="middle" class="texto">
						<?php
							if($objeto->wiki || $objeto->wiki == "0"){
								$count++;
						?>
							<img src="imagens/ok.gif" width="25" height="24">
						<?php
							}else{
						?>
							<img src="imagens/x.gif" width="25" height="24">
						<?php   } ?>
                                            </td>
                                            <td align="center" valign="middle" class="texto">
						<?php 
							if($objeto->wiki || $objeto->wiki == "0"){	
								echo $objeto->wiki;
							}else{
								echo "-";
							}
						?>
					    </td>
                                          </tr>
                                          <tr bgcolor="d8e4f5" class="texttab">
                                            <td valign="middle"> <div align="right">
                                                <p class="texto">Atividade com
                                                  o Blog</p>
                                              </div></td>
                                            <td>&nbsp;</td>
                                            <td align="center" valign="middle" class="texto">
						<?php
							if($objeto->blog || $objeto->blog == "0"){
								$count++;
						?>
							<img src="imagens/ok.gif" width="25" height="24">
						<?php
							}else{
						?>
							<img src="imagens/x.gif" width="25" height="24">
						<?php   } ?>
                                            </td>
                                            <td align="center" valign="middle" class="texto">
						<?php 
							if($objeto->blog || $objeto->blog == "0"){	
								echo $objeto->blog;
							}else{
								echo "-";
							}
						?>
					    </td>
                                          </tr>
                                          <tr bgcolor="d8e4f5" class="texttab">
                                            <td valign="middle"> <div align="right">
                                                <p class="texto">Exerc&iacute;cios
                                                  (m&eacute;dia) </p>
                                              </div></td>
                                            <td>&nbsp;</td>
                                            <td align="center" valign="middle" class="texto">
						<?php
							if($media || $media == "0"){
								$count++;
						?>
							<img src="imagens/ok.gif" width="25" height="24">
						<?php
							}else{
						?>
							<img src="imagens/x.gif" width="25" height="24">
						<?php   } ?>
                                            </td>
                                            <td align="center" valign="middle" class="texto">
						<?php 
							if($media || $media == "0"){	
								echo $media;
							}else{
								echo "-";
							}
						?>
					    </td>
                                          </tr>
                                          <tr bgcolor="d8e4f5" class="texttab">
                                            <td align="right" valign="middle" class="texto">Constru&ccedil;&atilde;o
                                              do Gloss&aacute;rio</td>
                                            <td valign="top">&nbsp;</td>
					    <td align="center" valign="middle" class="texto">
                                           	 <?php
							if($objeto->glossario || $objeto->glossario == "0"){
								$count++;
						?>
							<img src="imagens/ok.gif" width="25" height="24">
						<?php
							}else{
						?>
							<img src="imagens/x.gif" width="25" height="24">
						<?php   } ?>
                                            </td>
                                            <td align="center" valign="middle" class="texto">
						<?php 
							if($objeto->glossario || $objeto->glossario == "0"){	
								echo $objeto->glossario;
							}else{
								echo "-";
							}
						?>
					    </td>

                                          </tr>
                                          <tr bgcolor="9eb5d8" class="texttab">
                                            <td valign="middle"> <div align="right">
                                                <p class="texto">M&eacute;dia</p>
                                              </div></td>
                                            <td valign="top">&nbsp;</td>
                                            <td valign="middle" bgcolor="9eb5d8" class="texto">&nbsp;
                                            </td>
                                            <td align="center" valign="middle" class="texto">
						<?php 
							if($count == 0){
								$count++;
							}

							echo ($objeto->salaReuniao + $objeto->wiki + $objeto->blog + $objeto->glossario + $media)/$count;

						?>
					    </td>
                                          </tr>
                                        </table></td>
                                    </tr>
                                  </table></td>
                              </tr>
			      <?php } ?>
                            </table>
                          </div></td>
                      </tr>
                    </table> <br>
                  </td>
                  <td width="5%" align="right" background="imagens/bar_fnd_5.jpg"><a href="comunicacao.php"><img src="imagens/mn_5.jpg" width="23" height="146" border="0"></a>
                  </td>
                  <td width="6%" align="right" background="imagens/bar_fnd_4.jpg"><a href="banco.php"><img src="imagens/mn_4.jpg" width="23" height="219" border="0"></a>
                  </td>
                  <td width="5%" align="right" background="imagens/bar_fnd_3.jpg"><a href="ferramentasTrabalho.php"><img src="imagens/mn_3.jpg" width="23" height="249" border="0"></a>
                  </td>
                  <td width="3%" align="right" background="imagens/bar_fnd_2.jpg"><a href="conteudo.php"><img src="imagens/mn_2.jpg" width="23" height="113" border="0"></a></td>
                  <td width="8%" align="right" background="imagens/bar_fnd_1.jpg" bgcolor="F1FEF9">
                    <p><a href="principal.php"><img src="imagens/mn_1.jpg" width="23" height="103" border="0"></a></p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p></td>
                </tr>
              </table></td>
          </tr>
        </table></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
</div>
</body>
</html>
